package com.control.qct.businesssteward.adapter;

import android.support.annotation.Nullable;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.model.ComplimentaryStatisticModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/12/27 0027.
 */

public class ComplimentaryStatisticAdapter extends BaseQuickAdapter<ComplimentaryStatisticModel, BaseViewHolder> {
    private int max1;
    private int max2;
    private int max3;

    public ComplimentaryStatisticAdapter(@Nullable List<ComplimentaryStatisticModel> data) {
        super(R.layout.rv_complimentary_statistic_item, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, ComplimentaryStatisticModel item) {
        holder.setText(R.id.tv_goods_name, item.getName());
        holder.setProgress(R.id.pb_sell_price, item.getNum1(), max1).setProgress(R.id.pb_complimentary_price, item
                        .getNum2(),
                max2).setProgress(R.id.pb_complimentary_proportion, item.getNum3(), max3);
    }

    public void setMax1(int max1) {
        this.max1 = max1;
        notifyDataSetChanged();
    }

    public void setMax2(int max2) {
        this.max2 = max2;
        notifyDataSetChanged();
    }

    public void setMax3(int max3) {
        this.max3 = max3;
        notifyDataSetChanged();
    }
}
